#ifndef TERRAIN_H
#define TERRAIN_H
#include "vec3f.h"
#include <vector>
#include <tokamak.h>

struct Triangle { int p1, p2, p3; };

class Terrain
{
private:
	struct Point { float x, y, z; };
	struct TexCoord { float s, t; };
	int			m_Z;
	int			m_X;
	int			m_NumVertices;
	int			m_NumTriangles;
	Point*		m_Vertices;
	TexCoord*	m_TexCoords;
	Triangle*	m_Triangles;
	unsigned int dlist;

public:
	Terrain(const char* hmapFile, const char* textureFile);
	~Terrain(void);

	void		draw();
	float		getHeight(int x, int z);
	//Triangle*	getTriangles();
	int			getTriangleCount();
	void		buildPhysicsMesh(neSimulator* gSim);
};

#endif